﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin_Product.aspx.cs"
    Inherits="V5_EShop.Admin.Admin_Product" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <!--#include file="inc/libs.aspx"-->
    <script type="text/javascript">
        function editProductCode(obj) {
            if (!obj.checked) {
                $("#txtProductCode").attr("disabled", true);
            } else {
                $("#txtProductCode").attr("disabled", false);
            }
        }
    </script>
</head>
<body>
    <!--loading start-->
    <div id="loadingContainer">
        <div class="panel">
            <div class="loadIcon">
                <div>
                    正在加载...</div>
            </div>
        </div>
        <div id="loadingbackground">
        </div>
    </div>
    <!--loading end-->
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="toptable">
        <tr>
            <td class="topnavichar" style="padding-left: 14px">
                <div align="left">
                    位置导航：<a href="Admin_Index_Main.aspx" target="main" class="list_link">首页</a><img alt=""
                        src="/sysImages/folder/navidot.gif" border="0" />商品管理</div>
            </td>
        </tr>
    </table>
    <br />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="Navitable">
        <tr>
            <td align="left">
                <a href="Admin_Product.aspx?ClassID=<%=ClassID %>">管理商品</a> | <a href="Admin_Product.aspx?Action=edit&ClassID=<%=ClassID %>">
                    添加</a>
            </td>
        </tr>
    </table>
    <br />
    <form id="form1" runat="server">
    <asp:MultiView ID="MultiViewList" runat="server">
        <asp:View ID="View1" runat="server">
            <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" GridLines="None"
                CssClass="listtable" OnRowCommand="gvList_RowCommand">
                <HeaderStyle CssClass="headertext" />
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkitem" runat="server" />
                        </ItemTemplate>
                        <ItemStyle Width="30px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="ID" HeaderText="ID">
                        <ItemStyle Width="30px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="ProductName" HeaderText="商品名称" />
                    <asp:TemplateField HeaderText="市场价格">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ProductMarketPrice") %>'
                                Width="80px"></asp:TextBox>
                        </ItemTemplate>
                        <ItemStyle Width="100px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="会员价格">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Width="80px" Text='<%# Bind("ProductMemberPrice") %>'></asp:TextBox>
                        </ItemTemplate>
                        <ItemStyle Width="100px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="ProductCount" HeaderText="库存量">
                        <ItemStyle Width="60px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="缩图">
                        <ItemTemplate>
                            <img alt="" src="images/icon-viewpic.gif" onmouseover="outpic('../<%# DataBinder.Eval(Container.DataItem,"ProductBigPic") %>')"
                                onmouseout="nd();" />
                        </ItemTemplate>
                        <ItemStyle Width="50px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem,"IsPassed").ToString()=="1"?"√":"×" %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="商品属性">
                        <ItemTemplate>
                            &nbsp;<%# DataBinder.Eval(Container.DataItem, "IsRecommond").ToString() == "1" ? "推荐" : ""%>
                            <%# DataBinder.Eval(Container.DataItem, "IsNew").ToString() == "1" ? "新品" : ""%>
                            <%# DataBinder.Eval(Container.DataItem, "IsOnHot").ToString() == "1" ? "热点" : ""%>
                            <%# DataBinder.Eval(Container.DataItem, "IsSpecialOffer").ToString() == "1" ? "特价" : ""%>
                        </ItemTemplate>
                        <ItemStyle Width="180px" />
                    </asp:TemplateField>
                    <%--<asp:TemplateField HeaderText="产品图片">
                        <ItemTemplate>
                            <a onclick="ShowPictureDialog('Picture/Picture_Manage_Dialog_4.aspx',600,400);">图片管理</a>
                        </ItemTemplate>
                    </asp:TemplateField>--%>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#Eval("ID") %>'
                                CommandName="go">修改</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%#Eval("ID") %>'
                                CommandName="del">删除</asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle Width="150px" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <br />
            <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" class="listtable">
                <tr>
                    <td colspan="7">
                        搜索：
                        <asp:TextBox ID="txtSearchText" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" CausesValidation="False" Text="搜 索" OnClick="btnSearch_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="7" align="right">
                        <input name="chkall" type="checkbox" id="chkall" onclick="javascript:SelectAll(this);"
                            value="checkbox" />
                        全选/取消
                        <asp:DropDownList ID="ddlAll" runat="server">
                            <asp:ListItem Value="0">请选择一个操作</asp:ListItem>
                            <asp:ListItem Value="1">批量删除</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Button ID="btnAll" runat="server" Text="执行操作" EnableViewState="False" OnClick="btnAll_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="7" align="right">
                        <webdiyer:AspNetPager ID="Pager" runat="server" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条"
                            FirstPageText="首页" HorizontalAlign="Right" LastPageText="尾页" NextPageText="下一页"
                            OnPageChanged="Pager_PageChanged" PageIndexBoxType="DropDownList" PageSize="20"
                            PrevPageText="上一页" ShowCustomInfoSection="Left" ShowPageIndexBox="Always" SubmitButtonText="Go"
                            TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" AlwaysShow="True">
                        </webdiyer:AspNetPager>
                    </td>
                </tr>
            </table>
            <div id="overDiv" style="z-index: 1000; visibility: hidden; position: absolute">
            </div>
        </asp:View>
        <asp:View ID="View2" runat="server">
            <table align="center" border="0" cellpadding="5" cellspacing="1" class="edittable"
                style="width: 96%;">
                <tr class="headertext">
                    <td colspan="2">
                        &nbsp;
                        <asp:Label ID="lblTitle" runat="server" Text="添加商品"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td width="15%">
                        商品名称：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductName" runat="server" Width="355px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        所属分类：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlClassID" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        商品关键字：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductKeysWords" runat="server" Width="355px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        商品代码：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductCode" runat="server" Width="269px" Enabled="false"></asp:TextBox>
                        <input id="Checkbox1" type="checkbox" onclick="editProductCode(this)" />修改
                    </td>
                </tr>
                <tr>
                    <td>
                        商品品牌：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductBrand" runat="server" Width="251px"></asp:TextBox>
                        <asp:DropDownList ID="ddlProductBrand" runat="server" onchange="txtProductBrand.value=this.value;">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        商品单位：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductUnit" runat="server" Width="29px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        商品重量：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductWeight" runat="server" Width="29px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        商品市场价格：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductMarketPrice" runat="server" Width="55px">0</asp:TextBox>
                        ：元 会员价格
                        <asp:TextBox ID="txtProductMemberPrice" runat="server" Width="49px">0</asp:TextBox>
                        ：元
                    </td>
                </tr>
                <tr>
                    <td>
                        最低购买价格：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductMinPrice" runat="server" Width="55px">0</asp:TextBox>
                        ：元
                    </td>
                </tr>
                <tr>
                    <td>
                        商品大图：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductBigPic" runat="server" Width="262px"></asp:TextBox>
                        &nbsp;
                        <%--<input id="Button1" type="button" value="选择图片" onclick="OpenPictureDialog('txtProductBigPic',620,450);" />--%><input
                            id="Button2" type="button" value="选择图片" onclick="OpenPictureDialog1('txtProductBigPic',900,550);" />
                        请选择productm目录下的图片
                    </td>
                </tr>
                <tr>
                    <td>
                        商品多图：
                    </td>
                    <td>
                        <asp:GridView ID="dlProductMorePicList" runat="server" AutoGenerateColumns="False"
                            GridLines="None" OnRowCommand="dlProductMorePicList_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="说明">
                                    <ItemTemplate>
                                        <asp:Label ID="lblmorepictitle" runat="server" Text='<%#Bind("more1") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Width="100px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="图片地址">
                                    <ItemTemplate>
                                        <img alt="" src="images/icon-viewpic.gif" onmouseover="outpic('../<%# DataBinder.Eval(Container.DataItem,"more2") %>')"
                                            onmouseout="nd();" id="imgpicurl" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID") %>'
                                            CommandName="picgo" CausesValidation="False">修改</asp:LinkButton>
                                        <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID") %>'
                                            CommandName="picdel" CausesValidation="False">删除</asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle Width="100px" />
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <asp:HiddenField ID="hfsID" runat="server" />
                        说明:
                        <asp:TextBox ID="txtProductMorePicReadme" runat="server" Width="78px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtProductMorePicReadme"
                            ErrorMessage="*"></asp:RequiredFieldValidator>
                        地 址:<asp:TextBox ID="txtProductMorePicSelect" runat="server" Width="219px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtProductMorePicSelect"
                            ErrorMessage="*"></asp:RequiredFieldValidator>
                        &nbsp;
                        <asp:Button ID="txtProductMorePicSave" runat="server" Text="添加" OnClick="txtProductMorePicSave_Click" />
                        &nbsp;&nbsp;&nbsp;
                        <input id="Button5" onclick="OpenPictureDialog1('txtProductMorePicSelect',900,550);"
                            type="button" value="选择图片" />
                        请选择productm目录下的图片
                    </td>
                </tr>
                <tr>
                    <td>
                        商品数量：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductCount" runat="server" Width="37px">10</asp:TextBox>
                        ：个
                    </td>
                </tr>
                <tr>
                    <td>
                        商品属性：
                    </td>
                    <td>
                        <asp:Repeater ID="rpFieldList2" runat="server">
                            <ItemTemplate>
                                <li>
                                    <asp:Label ID="lblTitle" runat="server" Text='<%#Eval("FieldName") %>'></asp:Label>:<asp:TextBox
                                        ID="txtFieldName" runat="server" Text='<%#Eval("FieldValues") %>'></asp:TextBox></li>
                            </ItemTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
                <tr>
                    <td>
                        商品扩展属性：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSelectType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlSelectType_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:Repeater ID="rpFieldList" runat="server" OnItemDataBound="rpFieldList_ItemDataBound">
                            <ItemTemplate>
                                <table style="width: 100%;">
                                    <tr>
                                        <td style="width: 10%;">
                                            <asp:Label ID="lblFieldName" runat="server" ForeColor="#0066FF" Text='<%#Eval("FieldName") %>'
                                                Width="40px"></asp:Label>
                                            <asp:HiddenField ID="hfFieldID" runat="server" Value='<%#Eval("ID") %>' />
                                        </td>
                                        <td>
                                            <asp:Repeater ID="rpFieldList2" runat="server">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chksingle" runat="server" Checked="false" Text='<%#Eval("singlefield") %>' />
                                                </ItemTemplate>
                                            </asp:Repeater>
                                            <asp:TextBox ID="txtFieldValue" runat="server" Text='<%#Eval("FieldValues") %>'></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
                <tr>
                    <td>
                        <span class="miaoshu02">商品尺码表：</span>
                    </td>
                    <td>
                        <FCKeditorV2:FCKeditor ID="txtProductSizeTable" runat="server" BasePath="../FckEditor/"
                            Height="350px" Width="100%">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
                <tr>
                    <td>
                        详细描述：
                    </td>
                    <td>
                        <FCKeditorV2:FCKeditor ID="txtContent" runat="server" BasePath="../FckEditor/" Height="350px"
                            Width="100%">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        洗剂说明:
                    </td>
                    <td style="height: 24px">
                        <asp:CheckBoxList ID="chkboxListXiJi" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="1">40度温水洗剂</asp:ListItem>
                            <asp:ListItem Value="2">分色洗剂</asp:ListItem>
                            <asp:ListItem Value="3">不可漂洗</asp:ListItem>
                            <asp:ListItem Value="4">低温熨烫 最高100度</asp:ListItem>
                            <asp:ListItem Value="5">常温干洗</asp:ListItem>
                            <asp:ListItem Value="6">转龙翻转干燥</asp:ListItem>
                        </asp:CheckBoxList>
                    </td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        商品属性：
                    </td>
                    <td style="height: 24px">
                        <asp:CheckBox ID="cbIsOnSale" runat="server" Checked="true" CssClass="checkboxaspx"
                            Text="上架" />
                        <asp:CheckBox ID="cbIsRecommond" runat="server" CssClass="checkboxaspx" Text="推荐" />
                        <asp:CheckBox ID="cbIsNew" runat="server" CssClass="checkboxaspx" Text="新品" />
                        <asp:CheckBox ID="cbIsHot" runat="server" CssClass="checkboxaspx" Text="热点" />
                        <asp:CheckBox ID="cbIsSpecialOffer" runat="server" CssClass="checkboxaspx" Text="特价" />
                        <asp:CheckBox ID="cbPackage" runat="server" CssClass="checkboxaspx" Text="打包" />
                        &nbsp;
                        <asp:CheckBox ID="chkIsPassed" runat="server" Checked="True" Text="立即发布" />
                    </td>
                </tr>
                <tr>
                    <td>
                        点击次数：
                    </td>
                    <td>
                        <asp:TextBox ID="txtHits" runat="server" Width="29px">0</asp:TextBox>
                        ：次
                    </td>
                </tr>
                <tr>
                    <td>
                        相关产品：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductRelated" runat="server" Width="250px"></asp:TextBox>
                        <asp:Button ID="btnSearchProduct" runat="server" CausesValidation="False" OnClick="btnSearchProduct_Click"
                            Text="搜索相关商品" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:GridView ID="gvAboutProduct" runat="server" AutoGenerateColumns="False" Width="40%">
                            <Columns>
                                <asp:TemplateField HeaderText="选择">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkitem1" runat="server" />
                                    </ItemTemplate>
                                    <HeaderTemplate>
                                        选择
                                    </HeaderTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="ID" HeaderText="ID" />
                                <asp:BoundField DataField="ProductName" HeaderText="商品名称" />
                                <asp:BoundField DataField="ProductCode" HeaderText="商品代码" />
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:HiddenField ID="txtChannelID" runat="server" Value="0" />
                        <asp:HiddenField ID="hfID" runat="server" Value="0" />
                        &nbsp;
                        <asp:Button ID="btnSave" runat="server" Text="添加保存" OnClick="btnSave_Click" CausesValidation="False" />
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    </form>
</body>
</html>
